/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       skill_icon.h

	$Header: /game/skill_icon.h $

	$NoKeywords: $

 ************************************************************************/

#ifndef SKILL_ICON_H_INCLUDED
#define SKILL_ICON_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "bitmap_layer_window.h"
#include "bitmap_group_ptr.h"
#include "skill.h"

enum  t_creature_ability;

// -------------------------------------------------------------------
// window to display a skill icon
// -------------------------------------------------------------------
class t_skill_icon : public t_bitmap_layer_window
{
public:
	t_skill_icon( t_screen_rect const& rect, t_window* parent );
	t_skill_icon( t_skill const& skill, t_screen_rect const& rect, t_window* parent);

    virtual void		 right_button_up( t_mouse_event const& event );

	void clear_custom_popup_text();
	void set_ability( t_creature_ability ability );
	void set_custom_popup_text( std::string const & popup_text );
	void set_skill( t_skill const& skill );
protected:
	void initialize();

	t_bitmap_group_ptr	   m_bitmaps;
	int					   m_height;
	t_skill				   m_skill;
	t_creature_ability	   m_ability;
	t_bitmap_layer_window* m_level_image;
	std::string			   m_custom_popup_text;
};

// -------------------------------------------------------------------
// Inline members
// -------------------------------------------------------------------

// -------------------------------------------------------------------
// Clear custom popup text and restore to defaults
// -------------------------------------------------------------------
inline void t_skill_icon::clear_custom_popup_text()
{
	m_custom_popup_text.erase();
}

// -------------------------------------------------------------------
// Override normal popup text with "popup_text"
// -------------------------------------------------------------------
inline void t_skill_icon::set_custom_popup_text( std::string const & popup_text )
{
	m_custom_popup_text = popup_text;
}


#endif // SKILL_ICON_H_INCLUDED

